<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>旅游问答</title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/js/datepicker/datepicker.css" rel="stylesheet">
    <link href="/styles/wendaDetail.css" rel="stylesheet" type="text/css">
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/styles/addtravelnote.css" rel="stylesheet" type="text/css">
    <link href="/js/ueditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <link href="/js/plugins/datepicker/datepicker.css" rel="stylesheet">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/ueditor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/ueditor/umeditor.min.js"></script>
    <script type="text/javascript" src="/js/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script src="/js/plugins/datepicker/datepicker.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link href="/js/plugins/chosen/chosen.css" rel="stylesheet" type="text/css">
    <link href="/js/plugins/jqPaginator/jqPagination.css" rel="stylesheet" type="text/css">
    <link href="/styles/wenda.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/plugins/chosen/chosen.jquery.js"></script>
    <script type="text/javascript" src="/js/system/common.js"></script>
    <script type="text/javascript" src="/js/system/addanswernote.js"></script>
    <script type="text/javascript" src="/js/system/public.js"></script>
    <style>
        .div1 {
            display: inline-block;
        }

        .zan {
            float: left;
            display: inline-block;
            width: 30px;
            height: 26px;
            background: url(/images/like30x26.png) no-repeat;
            overflow: hidden;
            margin-right: 9px;
            margin-top: -5px;
            margin-bottom: -5px;
        }

        .user-bar .i-goldmedal {
            border-color: #f8b11d;
            background-color: #fdb92c;
            background-position: 2px -518px;
        }

        .user-bar .identity {
            display: inline-block;
            height: 18px;
            margin-right: 4px;
            padding: 0 4px 0 20px;
            border-width: 1px;
            border-style: solid;
            border-radius: 10px;
            font-size: 12px;
            line-height: 18px;
            color: #fff;
            position: relative;
            vertical-align: middle;
        }
    </style>
    <script>
        $(function () {
            $("#subButton").click(function () {
                $("#editForm").ajaxSubmit(function (data) {
                    if (data.success) {
                        window.location.reload();
                    } else {
                        if (data.code = 102) {
                            popup(data.data);
                        } else {
                            popup(data.msg);
                        }
                    }
                })
            })
        })
    </script>
    <script>

        $(function () {
            //顶
            $('.thump').click(function () {
                var $thumb = $(this);
                var id = $thumb.data('aid');
                $.post('/answer/thump?aid=' + id, function (data) {
                    if (data.success) {
                        popup("顶成功啦!");
                        $thumb.html("顶 &emsp;" + data.data)
                    } else {
                        if (data.code == 102) {
                            popup("请登录!")
                        } else if (data.code == 103) {
                            popup('今天已经顶过了!');
                        } else {
                            popup(data.msg);
                        }
                    }
                })
            })

            //关注
            $('._j_same_question').click(function () {
                var atten = $(this);
                var $qid = atten.data('qid');
                $.get('/wenda/attention', {qid: $qid}, function (data) {
                    if (data.success) {
                        $("#attren").html('取消');
                        $('#attentionnum').html(data.data);
                        popup("关注成功");
                    } else {
                        if (data.code == 104) {
                            $("#attren").html('关注');
                            $('#attentionnum').html(data.data);
                            popup("已取消");
                        } else if (data.code == 102) {
                            popup("请登录");
                        } else {
                            popup(data.msg);
                        }
                    }
                })
            })
        })
    </script>
</head>

<body style="position: relative;">
<#assign currentNav="wenda">
<#include "../common/navbar.ftl">
<div class="wrapper">
    <div class="detail-wrap clearfix">
        <div class="col-main">
            <div class="q-detail">
                <div class="q-content">
                    <div class="q-title">
                        <a href="javascript:;" target="_blank" class="location"><i></i>${(q.dest.name)!}</a>
                        <h1>
                            <a href="javascript:;">${q.title!}</a>
                        </h1>
                    </div>

                    <div>
                        ${(q.questionContent.content)!}
                    </div>

                    <div class="q-info1 clearfix">
                        <div class="q-tags fl">
                            <#if q.dest??>
                                <a class="a-tag" href="javascript:;" target="_blank">${(q.dest.name)!}</a>
                            </#if>
                            <#if q.quesTags?? >
                                <#list q.quesTags as tag>
                                    <a class="a-tag _j_filter_click" href="javascript:;"
                                       target="_blank">${tag.name!}</a>
                                </#list>
                            </#if>
                        </div>
                        <div class="pub-bar fr">
                            <a href="javascript:;" class="photo" target="_blank"> <img
                                        src="${q.author.headImgUrl!}"
                                        width="16" height="16"></a>
                            <a class="name" href="javascript:;"
                               target="_blank">${q.author.nickname!}</a>
                            <span class="time"><span>${q.createTime?string("yyyy-MM-dd HH:ss")!}</span></span>
                        </div>
                    </div>
                </div>

                <div class="q-operate clearfix">

                    <div class="fl">
                        <!-- 问题分享 -->
                        <div class="q-share cate-share">
                            <a class="_js_showShare"><i class="q-share-icon"></i>分享</a>
                            <div class="share-pop _j_share_pop hide clearfix" data-title="${q.title}"
                                 data-qid="18458675">
                                <a title="分享到新浪微博" class="sina _j_do_share" data-site="wb"></a>
                                <a title="分享到QQ空间" class="zone _j_do_share" data-site="qz"></a>
                                <a title="分享到微信" class="weixin _j_do_share_wx" data-site="wx"></a>
                            </div>
                        </div>
                        <!-- 邀请回答 -->
                        <div class="seek-help _j_tip_box">
                            <a class="_j_seek_help_new">邀请蜂蜂回答</a>
                        </div>
                        <!-- 举报 -->
                        <div class="admin_hide tip-off">
                            <a data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-18458675.html"
                               data-refer-uid="43303516" data-app="qa.question" data-busi-id="qid:18458675">举报</a>
                        </div>
                    </div>

                    <div class="fr">
                        <span class="atten-num">${vo.viewnum!0}浏览</span>
                        <span class="atten-num"><span class="_j_same_num" id="attentionnum">${vo.attentionnum!0}</span>人关注</span>

                        <a class="btn-atten _j_same_question " rel="nofollow" data-status="1" data-qid="${q.id}">
                            <#if isAttention?? && isAttention>
                                <span id="attren">取消</span>
                            <#else >
                                <span id="attren">关注</span>
                            </#if>
                        </a>

                        <#--                        <a class="btn-answer _j_btn_goanswer" rel="nofollow">回答</a>-->
                    </div>
                </div>
            </div>
            <div class="answer-wrap">
                <div class="hd">
                    <span class="view_all">共${vo.replynum!0}个回答</span>
                    <div style="display:none;"><span id="_j_anum">${vo.replynum!0}</span>个回答</div>
                </div>

                <div class="bd _j_pager_box">

                    <#list q.answers as a>
                        <ul class="answer-list answer_detail">
                            <div>
                                <li>
                                    <div class="answer-side _js_answerAva">
                                        <!-- <a class="btn-ding _js_zan "><i></i><span data-real_num="3">3</span></a> -->
                                    </div>
                                    <div class="answer-content _js_answer_content">
                                        <div class="answer-info clearfix">

                                            <div class="user-bar fl">
                                                <a class="_j_filter_click avatar" href="javascript:;"
                                                   target="_blank"><img
                                                            src='${a.author.headImgUrl!}'
                                                            width="48" height="48" class="photo"></a>
                                                <a class="name" href="javascript:;"
                                                   target="_blank">${a.author.nickname!}</a>
                                                <a class="level" href="javascript:;" target="_blank"
                                                   rel="nofollow">LV.${a.author.level!} </a>
                                                <a class="identity i-goldmedal thump" data-aid="${a.id}"
                                                   href="javascript:;">顶
                                                    &emsp;${a.thumsupnum!0}</a>
                                                <#--                                                <a class="identity i-guide" href="javascript:;" target="_blank">指路人</a>-->

                                            </div>
                                            <#if a.level = 1>
                                                <ul class="answer-medal fr">
                                                    <li class="gold">
                                                        <div class="btn"><i></i><a href="javascript:;"
                                                                                   target="_blank">金牌回答</a></div>
                                                    </li>
                                                </ul>
                                            </#if>
                                        </div>

                                        <!-- 回答内容 -->
                                        <div class="_j_short_answer_item hide" style="display: block;">
                                            ${(a.content.content)!}
                                        </div>
                                    </div>
                                </li>
                            </div>
                        </ul>
                    </#list>

                </div>


                <form action="/answer/saveOrUpdate" method="post" id="editForm">
                    <input type="hidden" name="questionId" value="${q.id}">
                    <div class="bd _j_pager_box">
                        <div class="aa-hd">
                            <a class="aa-avatar" href="/wenda/u/53383161/answer.html"><img
                                        src="http://n1-q.mafengwo.net/s12/M00/35/98/wKgED1uqIreAU9QZAAAXHQMBZ74008.png?imageMogr2%2Fthumbnail%2F%2148x48r%2Fgravity%2FCenter%2Fcrop%2F%2148x48%2Fquality%2F90"
                                        class="photo"></a>
                            <a class="aa-name">${(userInfo.nickname)!'未登录'}</a>
                        </div>
                        <div class="editor-outer _j_editorOuter _js_editorWrap _js_forFixTitle">
                            <dl class="body cf">
                                <dd id="content_div">
                                    <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
                                </dd>
                            </dl>
                        </div>
                        <div class="aa-ft">
                            <input class="btn-comment _j_submit_answer_btn" type="button" value="提交回答" id="subButton"/>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="col-side"></div>
    </div>
</div>
</body>

</html>